var http = require('http');

var url = require('url');
var ejs = require('ejs');
var list = [111, 222, 333, 444, 555];
http.createServer((request, response) => {
	var pathname = url.parse(request.url).pathname;
	response.writeHead(200, {'Content-Type': 'text-plain'});
	console.log(pathname);
	if (pathname == '/login') {
		ejs.renderFile('../view/login.ejs', {
			msg: "asdfasdf",
			list: list
		}, (error, data) => {
			console.log(data);
			response.end(data);
		})
	} else {
		ejs.renderFile('../view/404.ejs', {
			msg: "asdfasdf",
			list: list
		}, (error, data) => {
			console.log(data);
			response.end(data);
		})
	}
}).listen(8124);

console.log("http://127.0.0.1:8124")
